﻿@model Website.Models.ModelMetadata.Pager

<div class="pager">
    @if(!Model.IsFirst)
    {
        <a href="@Url.Action("Product","Home", new{catID = Model.CategoryID, page = 1, search = Model.Search})"> << </a>    
    }
    @if (Model.HasPrevious)
    {
        <a href="@Url.Action("Product", "Home", new { catID = Model.CategoryID, page = (Model.CurrentPage - 1), search = Model.Search })"> < </a>
    }
    
    @if(Model.LastPage > 1)
    {
        <span>Trang @Model.CurrentPage / @Model.LastPage</span>
    }
    else
    {
        <span>Trang 1</span>
    }
    
    @if(Model.HasNext)
    {
        <a href="@Url.Action("Product","Home", new{catID = Model.CategoryID, page = (Model.CurrentPage + 1), search = Model.Search})"> > </a>    
    }

    @if(!Model.IsLast)
    {
        <a href="@Url.Action("Product", "Home", new { catID = Model.CategoryID, page = Model.LastPage, search = Model.Search })"> >> </a>
    }
</div>